package leecode

func findPrefixScore(nums []int) []int64 {
	prefix := make([]int64, len(nums))
	sum, temp := 0, 0
	for i, num := range nums {
		sum = max(sum, num)
		temp = temp + num + sum
		prefix[i] = int64(temp)
	}
	return prefix
}
